package com.interview.javabase.thread;

import org.redisson.api.RLock;
import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.concurrent.*;

/**
 * @description: 读写锁
 *
 * @author: zhangshuguang@vichain.com
 * @date: 2019/06/14 13:49
 */
public class Demo14 {

    @Autowired
    RedissonClient redisson;

    public void aa(){
        RLock aa = redisson.getLock("aa");
        aa.tryLock();
    }

    public static void main(String[] args) throws InterruptedException {


        Semaphore sem = new Semaphore(1);
        sem.acquire();
        System.out.println("11");
        sem.release();
    }
}
